package com.ali.item.client;

import com.ali.item.common.DecreaseStockInput;
import com.ali.item.common.ItemInfoOutput;
import com.ali.item.common.ItemSkuOutput;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

/**
 * @ClassName ItemClient
 * @Description TODO
 * @Author Alistair.Chow
 * @date 2018/12/29 15:19
 * @Version 1.0
 */
@FeignClient(name = "item")
public interface ItemClient {

    /**
    *
    * 查询商品信息
    *
    * @param itemIdList item Id List
    * @return java.util.List<com.ali.order.entity.ItemInfo>
    */
    @PostMapping("/item/listForOrder")
    List<ItemInfoOutput> itemListForOrder(@RequestBody List<Integer> itemIdList);

    /**
    *
    * 查询库存信息
    *
    * @param skuIdList sku Id List
    * @return java.util.List<com.ali.order.entity.ItemSku>
    */
    @PostMapping("/sku/findAllByIdIn")
    List<ItemSkuOutput> skuListForOrder(@RequestBody List<Integer> skuIdList);

    /**
    *
    * 减库存
    *
    * @param decreaseStockInputList 购物车列表
    * @return void
    */
    @PostMapping("/sku/decreaseStock")
    void decreaseStock(@RequestBody List<DecreaseStockInput> decreaseStockInputList);
}
